﻿Imports System.IO
Imports System.Runtime.Serialization.Formatters.Binary

Namespace Dominio
    Friend Class UIManager

        Public Shared Function CantidadDiasDelMes(ByVal mes As Integer) As Integer
            Select Case mes
                Case 1
                    Return 31
                Case 2
                    '//Pregunto si es año bisiesto
                    If (Date.Now.Year Mod 4 = 0) Then
                        Return 28
                    Else
                        Return 29
                    End If
                Case 3
                    Return 31
                Case 4
                    Return 30
                Case 5
                    Return 31
                Case 6
                    Return 30
                Case 7
                    Return 31
                Case 8
                    Return 31
                Case 9
                    Return 30
                Case 10
                    Return 31
                Case 11
                    Return 30
                Case 12
                    Return 31
            End Select
        End Function

        Public Shared Sub LimpiarSesiones(ByVal strNombrePagina As String)
            For i As Integer = 0 To HttpContext.Current.Session.Count - 1
                If (HttpContext.Current.Session.Contents.Keys(i).ToString.Contains("BORRAR") = True) AndAlso _
                (HttpContext.Current.Session.Contents.Keys(i).ToString.Contains(strNombrePagina) = False) Then
                    HttpContext.Current.Session(i) = Nothing
                End If
            Next
        End Sub

    End Class
End Namespace



